package com.franklin.java.action.sql.run;

import java.util.Objects;

/**
 * @author Franklin
 * @since 2021/9/22 17:17
 */
public class MybatisParam {

    private String elExpression;

    private boolean isString = false;

    private boolean isTest = false;

    public MybatisParam(String elExpression, boolean isString) {
        this(elExpression,isString,false);
    }

    public MybatisParam(String elExpression, boolean isString, boolean isTest) {
        this.elExpression = elExpression;
        this.isString = isString;
        this.isTest = isTest;
    }

    public String getElExpression() {
        return elExpression;
    }

    public boolean isString() {
        return isString;
    }

    public boolean isTest() {
        return isTest;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MybatisParam that = (MybatisParam) o;
        return isString == that.isString && isTest == that.isTest && Objects.equals(elExpression, that.elExpression);
    }

    @Override
    public int hashCode() {
        return Objects.hash(elExpression, isString, isTest);
    }
}
